package vpc

import (
	openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client"
	vpc20160428 "github.com/alibabacloud-go/vpc-20160428/v6/client"

	"aliyun-sdk/aliyun/credential"
)

func CreateClient(accessKeyid, accessKeySecret, endpoint string) (result *vpc20160428.Client, err error) {
	c, err := credential.CreateCredentials(accessKeyid, accessKeySecret)
	if err != nil {
		return nil, err
	}
	config := &openapi.Config{
		Credential: c,
		Endpoint:   &endpoint,
	}
	r, err := vpc20160428.NewClient(config)
	if err != nil {
		return nil, err
	}
	return r, nil
}
